<div class="row">
	<div class="col-md-12">
		<h1>Hoá đơn <small>Danh sách hoá đơn</small></h1>
		<ol class="breadcrumb">
            <li><a href="<?php echo mns_page_url(); ?>"><i class="fa fa-dashboard"></i> Dashboard</a></li>
            <li class="active"><i class="fa fa-table"></i> Các hoá đơn hiện có</li>
        </ol>
    </div>
</div>

<div class="row">
    <div class="col-md-6 col-xs-12">
        <form method="get" action="<?php echo mns_page_url(ORDER_SLUG.'/tim-kiem'); ?>" enctype="multipart/form-data">
            <div class="input-group">
            <input type="text" class="form-control" name="s" value="<?php echo isset($searchkey)?$searchkey:''; ?>" placeholder="Tìm kiếm hóa đơn" />
                <span class="input-group-btn">
                    <button class="btn btn-success" type="submit"><i class='glyphicon glyphicon-search'></i> Tìm kiếm!</button>
                </span>
            </div><!-- /input-group -->
        </form>
    </div>

    <div class="col-md-12 mgt10">
        <?php echo $pagingBar; ?>
        <div class="clearfix"></div>
    </div>

    <div class="col-md-12 mgt10">
        <div class="table-responsive">
            <table class="table table-bordered table-hover tablesorter item-list" data-href="<?php echo mns_page_url('hoa-don/kich-hoat'); ?>">
                <thead>
                    <tr>
                        <th class="header"># <i class="fa fa-sort"></i></th>
                        <th class="header">Ngày lập <i class="fa fa-sort"></i></th>
                        <th class="header">Thông tin đặt hàng <i class="fa fa-sort"></i></th>
                        <th class="header">Thông tin ngưởi nhận<i class="fa fa-sort"></i></th>
                        <th class="header">Ghi chú <i class="fa fa-sort"></i></th>
                        <th class="header">Chi tiết </th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach($aOrder as $index=>$tOrder) { ?>
                    <tr class="can-edit" data-id="<?php echo $this->encrypt->encode($tOrder->getId()); ?>">
                        <th class="header bg-info"><?php echo $index+1; ?></th>
                        <td>
                            <span class='strong'><?php echo fdate_format($tOrder->getCreatedAt(), 'd/m/Y'); ?></span>
                            <br/><br/>
                            <span><?php echo fdate_format($tOrder->getCreatedAt(), 'H:i:s'); ?></span>
                        </td>
                        <td>
                            <h4 class="text-capitalize"><?php echo $tOrder->getName(); ?></h4>
                            <p>Email : <?php echo $tOrder->getEmail(); ?></p>
                            <p>Số điện thoại : <?php echo $tOrder->getPhone(); ?></p>
                            <p>Địa chỉ : <?php echo $tOrder->getAddress(); ?></p>
                        </td>
                        <td>
                            <h4 class="text-capitalize"><?php echo $tOrder->getReceiverName(); ?></h4>
                            <p>Email : <?php echo $tOrder->getEmail(); ?></p>
                            <p>Số điện thoại : <?php echo $tOrder->getReceiverPhone(); ?></p>
                            <p>Địa chỉ : <?php echo $tOrder->getReceiverAddress(); ?></p>
                        </td>
                        <td>
                            <h4>#<?php echo $tOrder->getId(); ?></h4>
                            <?php echo $tOrder->getNote(); ?>
                        </td>
                        <td>
                            <a class="btn btn-success" data-toggle="modal" data-target="#modal-order-detail" href="<?php echo mns_order_single_url($tOrder->getId()); ?>">
                                <i class="fa fa-bars"></i>
                                Chi tiết
                            </a>
                        </td>
                    </tr>
                    <?php } ?>
                </tbody>
            </table>
        </div>
    </div>
    <div class="clearfix"></div>
</div>

<!-- Modal -->
<div class="modal fade" id="modal-order-detail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
        </div>
    </div>
</div>